﻿<div style="text-align: center">
    <MButton Color="error"
             OnClick="OnClick"
             StopPropagation>
        Show Overlay
    </MButton>

    <MOverlay Value="overlay"></MOverlay>
</div>

@code {
    bool overlay = false;

    async Task OnClick(MouseEventArgs args)
    {
        overlay = true;
        await InvokeAsync(StateHasChanged);

        await Task.Delay(2000);
        overlay = false;
    }
}
